#include "MouseEvent.h"
MouseEvent::MouseEvent(UIControl* p_pSender) : UIEvent(p_pSender)
{
}

MouseEvent::~MouseEvent()
{
}

int MouseEvent::getX()
{
	return m_iX;
}

int MouseEvent::getY()
{
	return m_iY;
}

void MouseEvent::mouseUp(int p_iX, int p_iY, MOUSE_BUTTON p_mb)
{
	m_iX = p_iX;
	m_iY = p_iY;
	switch (p_mb)
	{
	case MIDDLE:
		m_isMButtonDown = false;
		break;
	case LEFT:
		m_isLButtonDown = false;
		break;
	case RIGHT:
		m_isRButtonDown = false;
		break;
	}
}

void MouseEvent::mouseDown(int p_iX, int p_iY, MOUSE_BUTTON p_mb)
{
	m_iX = p_iX;
	m_iY = p_iY;
	switch (p_mb)
	{
	case MIDDLE:
		m_isMButtonDown = true;
		break;
	case LEFT:
		m_isLButtonDown = true;
		break;
	case RIGHT:
		m_isRButtonDown = true;
		break;
	}
}

bool MouseEvent::isMouseDown(MOUSE_BUTTON p_mb)
{
	switch (p_mb)
	{
	case MIDDLE:
		return m_isMButtonDown;
	case LEFT:
		return m_isLButtonDown;
	case RIGHT:
		return m_isRButtonDown;
	default:
		return false;
	}
}
